package com.xxx.controller;

import com.xxx.controller.utils.R;
import com.xxx.pojo.District;
import com.xxx.service.DistrictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/district")
public class DistrictController extends BaseController {
    @Autowired
    private DistrictService districtService;

    @RequestMapping("/")
    public R getDistrict(String parent){
        parent=parent.trim();
        List<District> result = districtService.getByParent(parent);
        return new R(OK,result);
    }
}
